<template>
  <div id="app">
    <el-container>
      <el-header>
        <div class="header-content">
          <h1>发票信息结构化提取与智能分析系统</h1>
          <el-button @click="logout">退出</el-button>
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px" style="height: 89vh;">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#F2F6FC"
            text-color="#333"
            active-text-color="#409EFF"
            style="height: 100%;">
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>Navigation One</span>
              </template>
              <el-menu-item-group>
                <template slot="title">Group One</template>
                <el-menu-item index="1-1">
                  <router-link to='/photo-preprocess'>
                    图像预处理
                  </router-link>
                </el-menu-item>
                <el-menu-item index="1-2">
                  <router-link to="/invoice-photo-analysis">
                    发票照片分析检测
                  </router-link>
                </el-menu-item>
                <el-menu-item index="1-3">
                  <router-link to="/entered-data">
                    已录入数据
                  </router-link>
                </el-menu-item>
                <el-menu-item index="1-4">
                  <router-link to="/history-record">
                    历史记录
                  </router-link>
                </el-menu-item>
                <el-menu-item index="1-5">
                  <router-link to="/data-analysis">
                    数据分析
                  </router-link>
                </el-menu-item>
                <!-- <el-menu-item index="1-6">
                  <router-link to="/data-chart">
                    数据可视化
                  </router-link>
                </el-menu-item> -->
                <el-menu-item index="1-7">
                  <router-link to="/check-invoice">
                    发票验证真伪
                  </router-link>
                </el-menu-item>
                <el-menu-item index="1-8">
                  <router-link to="/data-excel">
                    数据导出Excel
                  </router-link>
                </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'App',
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    logout() {
      this.$router.push('/login');
    }
  }
}
</script>

<style scoped>
.el-header {
  background-color: #409EFF;
  color: #fff;
  line-height: 30px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info {
  margin-right: 20px;
  font-size: 50px;
  text-align: right;
}

.el-dropdown-link {
  cursor: pointer;
  color: #fff;
}

.el-aside {
  background-color: #F2F6FC;
  color: #333;
  text-align: left;
  line-height: 200px;
}

.el-main {
  background-color: #fff;
  color: #333;
  text-align: left;
  padding: 20px;
}

.el-menu,
.el-submenu .el-menu-item,
.el-submenu__title {
  font-size: 16px;
  font-weight: bold;
}

.el-menu-item a {
  text-decoration: none;
  color: inherit;
}

.el-menu-item.is-active a {
  color: #409EFF;
}

.user-info .el-dropdown-menu {
  display: block !important;
}
</style>    